﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;

using CRMEntity;
using CRMFramework;

namespace CRMBiz
{
    public static class AccountHandler
    {
    
        //login
        public static ResultsStatus Login(string username, string password)
        {
            ResultsStatus res=ResultsStatus.Success;

            try
            {
                 string query = "select * from crm_account where accountuser='"+username +"'"+"and accountpassword='"+password+"'";
                DataTable dt = DBhelper.ExecuteDatasetQuery(query).Tables[0];

                if (dt.Rows.Count == 0)
                {
                    res = ResultsStatus.Empty;
                }
               
            }
            catch (Exception)
            {
                res = ResultsStatus.Error;
            }
            return res;
        }

      

    }
}
